package com.kzf.mapper;

import com.kzf.pojo.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClassMapper {

    public List<ClazzDTO> getList(ClassQueryParam classQueryParam);

    @Delete("delete from clazz where id = #{id}")
    public void delete(Integer id);

    @Insert("insert into clazz(name, room, begin_date, end_date, master_id, subject, create_time, update_time)values (#{name}," +
            "#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{createTime},#{updateTime})")
    void insert(Clazz clazz);

    @Select("select * from clazz where id = #{id}")
    ClassById getById(Integer id);

    void update(Clazz clazz);

    @Select("select * from clazz")
    List<ClassById> getAll();
}
